home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
et
/
et3_0-a1.lha
/
et3
/
src
/
Clipper.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-07-21
|
3KB
|
99 lines
#ifndef Clipper_First
#ifdef __GNUG__
//pragma once
#pragma interface
#endif
#define Clipper_First
#include "VObject.h"
enum ClipperFlags {
eClipperDefault = eVObjDefault,
eClipperLast = eVObjLast+0
};
class Clipper: public VObject {
protected:
Point minExtent, relOrigin;
float scale;
VObject *vop; // the VObject I show
Ink *bgcolor;
bool deleteVop;
void FeedbackOnce(Command *tracker, Point ap, Point pp, bool turniton);
Point Offset()
{ return contentRect.origin - relOrigin; }
public:
MetaDef(Clipper);
Clipper(VObject *vp= 0, Point minsize= gPoint_1, int id= cIdNone, Ink *bg= 0);
~Clipper();
void SetDeleteVop(bool dv)
{ deleteVop= dv; }
void Open(bool mode= TRUE);
void SetContainer(VObject*);
Metric GetMinSize();
void SetMinExtent(Point e);
Point GetMinExtent()
{ return minExtent; }
void Focus();
void Enable(bool b= TRUE, bool redraw= TRUE);
VObject *Detect(BoolFun find, void *arg);
void SetBgInk(Ink *);
Ink *GetBgInk();
void ScaleUp(Point &p);
void ScaleDown(Point &p);
void SetZoom(float z);
float GetZoom()
{ return scale; }
//---- drawing ------------------------
void DrawInner(Rectangle, bool);
void DrawInFocus(VoidObjMemberFunc, Object*, void*, void*, void*, void*);
void Feedback(Object*, void*, void*, void*);
//---- event handling -----------------
Command *DispatchEvents(Point lp, Token &t, Clipper *cl);
Point ContainerPoint(Point p);
bool TrackOnce(Command**, TrackPhase, Point, Point, Point);
Command *TrackInContent(Point, Token, Command*);
void SendDown(int, int, void*);
void Control(int, int, void*);
void ReadEvent(Token &t, int timeout= -1, bool overread= TRUE);
//---- resize -------------------------
void SetExtent(Point e);
void SetOrigin(Point at);
void Normalize();
void ExtentChanged(VObject *what);
//---- views --------------------------
void Add(VObject*);
VObject *Remove(VObject*);
void ViewSizeChanged();
Point GetViewSize();
Rectangle GetViewedRect();
VObject *GetViewedVObject()
{ return vop; }
void InvalidateViewRect(Rectangle r);
//---- scrolling ----------------------
Point GetRelOrigin()
{ return relOrigin; }
virtual Point AutoScroll(Point);
virtual void Scroll(int mode, Point scroll, bool redraw= TRUE);
void RevealRect(Rectangle, Point);
void RevealAlign(Rectangle r, VObjAlign al= VObjAlign(eVObjHLeft+eVObjVTop));
//---- input/output --------------------
OStream& PrintOn(OStream&);
IStream& ReadFrom(IStream&);
//---- inspecting ----------------------
void InspectorId(char *buf, int sz);
void CollectParts(Collection*);
};
#endif